<?php
namespace app\common\library\Utils;

use GuzzleHttp\Client;


class Location{
    public static function positionToLocation($lat,$lng){
        $options = [
            'base_uri'        => "https://apis.map.qq.com",
            'verify'          => false,
            'http_errors'     => false,
        ];
        $client = new Client($options);

        $data = [
            'query' => [
                'location' => "{$lat},{$lng}",
                'key' => 'BX6BZ-EFPAF-UGZJS-NZ5DW-OZZJH-B6B6X',
            ]
        ];
        var_dump($data);
        $response = $client->get('/ws/geocoder/v1', $data);
         $body     = $response->getBody();
         $content  = $body->getContents();
        return $content;
    }
}